﻿<%@ WebHandler Language="C#" Class="LienKetWeb_UpdateStatus" %>

using System;
using System.Web;
using HNG.Portal.BLL;
using HNG.Portal.DAL;
using HNG.Portal.DAL.EntityClasses;
using HNG.Portal.DAL.FactoryClasses;
using HNG.Portal.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

public class LienKetWeb_UpdateStatus : IHttpHandler
{
    TblLienKetWebManager _TblLienKetWebManager = new TblLienKetWebManager();
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";
        string check = "";
        int SupportID = 0;
        try{SupportID = Convert.ToInt32(context.Request.QueryString["id"].Trim());}
        catch{SupportID = 0;}

        if (SupportID != 0)
        {
            TblLienKetWebEntity _TblLienKetWebEntity = _TblLienKetWebManager.SelectOne(SupportID);
            _TblLienKetWebEntity.TrangThai = !_TblLienKetWebEntity.TrangThai;
            check = _TblLienKetWebEntity.TrangThai.ToString();

            try { _TblLienKetWebManager.Update(_TblLienKetWebEntity).ToString(); check = _TblLienKetWebEntity.TrangThai.ToString().ToLower(); }
            catch { }
        }
        context.Response.Write(check);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}